package com.njuse.jvmfinal.Instruction;

import java.nio.ByteBuffer;

import com.njuse.jvmfinal.runtimestructure.Jframe;

public class D2F extends Instruction {
	
	public  void readindex(ByteBuffer reader) {
		//pass
	}
	
	public  void execute(Jframe frame) {
		int top=frame.getStacktop();
		Object[] stack=frame.getManagestack();
		int high=(int) stack[top-1];
		int low=(int) stack[top-2];
		top=top-2;
		long tempnumber=(((long) high) << 32) | ((long) low & 0x0ffffffffL);
		double temp=Double.longBitsToDouble(tempnumber);
		float number=(float) temp;
		int tempp=Float.floatToIntBits(number);
		stack[top]=tempp;
		top++;
		frame.setManagestack(stack);
		frame.setStacktop(top);
	}
}
